<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="andreas08.css" type="text/css" media="screen,projection" />
<script type="text/javascript" src="/js/page.js"></script>
<script type="text/javascript">
function new_doc(id){
	var newwin = window.open_centered("dettaglio_doc_progetto.php?_i="+id, "news", 650, 490, "");
}
</script>
<title>Intranet Docenti</title>

</head>
<body>
<div id="container" >

<div id="header">
<h1>Scuola Media E. d'Arborea - Lamarmora</h1>
<h2>area riservata ai docenti</h2>
</div>

<?php include "navigation.php" ?>

<div id="content">
<h2 style="text-align: center">Documenti pubblicati</h2>
<table style="margin: auto; width: 100%">
            <tr>
                <td style="width: 40%; color: #003366; font-weight: bold">Titolo</td>
                <td style="width: 30%; color: #003366; font-weight: bold">Progetto</td>
                <td style="width: 15%; color: #003366; text-align: center; font-weight: bold">File</td>
                <td style="width: 15%; color: #003366; text-align: center; font-weight: bold">AS</td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <?php 
            $x = 1; // contatore grafico
		    if($res_docs->num_rows > $limit)
		    	$max = $limit;
		    else
		    	$max = $res_docs->num_rows;
		    	
            while($row = $res_docs->fetch_assoc()){
            	if($x > $limit) break;
            	if($x%2)
					$bg = "background-color: rgb(247,247,250)";
				else
					$bg = "";
				// tipo file
				$path_parts = pathinfo($row['file']);
            ?>
            <tr style="<?php print $bg ?>">
                <td style="width: 40%; "><a href="#" onclick="new_doc(<?php print $row['id'] ?>)" style="font-weight: normal"><?php print $row['titolo'] ?></a></td>
                <td style="width: 30%; color: #003366; "><?php print $row['proj'] ?></td>
                <!-- <td style="width: 30%; color: #003366; "><?php print $row['abstract'] ?></td> -->
                <td style="width: 15%; color: #003366; text-align: center"><?php print strtoupper($path_parts['extension']) ?></td>
                <td style="width: 15%; color: #003366; text-align: center"><?php print $row['descrizione'] ?></td>
            </tr>
            <?php 
                $x++;
            }
            include $_SERVER['DOCUMENT_ROOT']."/shared/navigate.php";
            ?>
            <tr>
                <td colspan="4" style="height: 50px">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4" align="right">
                	<a href="#" onclick="new_doc(0)" >Nuovo documento</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                	<a href="#" onclick="document.location.href='index.php'">Torna al men&ugrave;</a> 
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;&nbsp;&nbsp;</td>
            </tr>
        </table>


</div>
<div id="subcontent">
<?php include "menu_docs.php" ?>

<!-- 
<h2>Favorite Links</h2>
<ul class="menublock">
  <li><a href="http://andreasviklund.com/templates">Free website templates</a></li>
  <li><a href="http://openwebdesign.org">Open Web Design</a></li>
  <li><a href="http://www.solucija.com/index.php?id=17">sNews CMS</a></li>
  <li><a href="http://oswd.org">OSWD.org</a></li>
</ul>

<div id="searchbar"><h2>Search This Site</h2>
<form action="#" method="get"><fieldset>
<input value="demo only" name="s" id="s" alt="not functional, demo only" />
<input type="submit" value="Go!" id="searchbutton" name="searchbutton" />
</fieldset></form>
</div>
 -->
</div>

<?php include "footer.php" ?>

</div>
</body>    
</html>
